package com.example.android.bluetoothchat;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;

import com.example.android.common.activities.SampleActivityBase;

/**
 * Created by Administrator on 2017/4/24 0024.
 *
 * 程序过渡页
 */
public class SplashActivity extends SampleActivityBase {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 设置不显示titlebar
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        // 延迟2.5秒进入主页
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                go(SplashActivity.this);
                finish();
            }
        }, 2500);
    }
    
    /**
     * 计入主页
     *
     * @param context
     */
    public static void go(Context context) {
        Intent intent = new Intent(context, MainActivity.class);
        context.startActivity(intent);
    }

}
